package org.example.config;

import org.example.filter.RequestFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter( requestFilter());
        registration.setName("requestFilter");
        registration.addUrlPatterns("/*");
        registration.setOrder(10);
        return registration;
    }

    @Bean
    public RequestFilter requestFilter(){
        return new RequestFilter();
    }


















}



